import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login'
import Main from '../views/Main'
import Admin from '../views/menu/Admin'
import Disk from '../views/menu/Disk'
import Adminadd from '../views/menu/Adminadd'
import Share from '../views/menu/Share'
import User from '../views/menu/User'

Vue.use(VueRouter)

//1.创建路由组件 就是路由页面
const routes = [
  {
    path: '/',
    redirect: 'admin',
    component: Main,
    children: [
      { path: 'admin', component: Admin },
      { path: 'disk', component: Disk },
      { path: 'adminadd', component: Adminadd },
      { path: 'share', component: Share },
      { path: 'user', component: User },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  }
]



const router = new VueRouter({
  routes
})

export default router
